<#import "/global.ftl" as global_macro />
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
    <title>Title</title>
    <style type="text/css">
        body {
            width: 100%;
            height: 100%;
            margin: 0;
            overflow: hidden;
        }
    </style>
<@global_macro.importEasyUi/>
</head>
<body>
<script type="text/javascript">
    var testStr = "<@global_macro.basePath/>";
</script>
<div style="margin:20px 0;"></div>
<div class="easyui-panel" title="New Topic" style="width:100%;max-width:400px;padding:30px 60px;">
    <form id="ff" method="post">
        <div style="margin-bottom:20px">
            <input class="easyui-textbox" name="systemUser.loginName" value="admin" style="width:100%" data-options="label:'loginName:',required:true">
        </div>
        <div style="margin-bottom:20px">
            <input class="easyui-passwordbox" name="systemUser.loginPassword" value="admin" style="width:100%" data-options="label:'loginPassword:',required:true">
        </div>
    </form>
    <div style="text-align:center;padding:5px 0">
        <a href="javascript:void(0)" class="easyui-linkbutton" onclick="submitForm()" style="width:80px">Submit</a>
        <a href="javascript:void(0)" class="easyui-linkbutton" onclick="clearForm()" style="width:80px">Clear</a>
    </div>
</div>
<@global_macro.importEasyUiJs/>
<script>
    function submitForm(){
        $.post('<@global_macro.basePath/>/login',
                $("#ff").serialize(),
                function(data){
                    if(false==data.success)
                    {
                        $.messager.alert('Error',data.message);
                    } else {
                        window.location.href='<@global_macro.basePath/>/admin/index';
                    }
                });
    }
    function clearForm(){
        $('#ff').form('clear');
    }
</script>
</body>
</html>